<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fc.util.*" %>
<%@ page import="com.fc.model.Store" %>
<%@ page import="com.fc.control.StoreControl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>store</title>
<script>
  	$(function(){
				//添加隔行换色
				$("tbody tr:odd").addClass("oddTR");
				
				// 添加鼠标经过样式
				$("tbody tr").mouseover(function(){
					$(this).addClass("mouseOverTR");
					$(this).children("td").each(function(){
						$(this).addClass("mouseOverTD");
						});
				});
					
				
				$("tbody tr").mouseout(function(){
					$(this).removeClass(["mouseOverTR"]);
					$(this).children("td").each(function(){
							$(this).removeClass(["mouseOverTD"]);
						});
					});
			})
			
  </script>
</head>
<body>
<form>
<strong>健身场馆列表</strong>
   <table>
   <thead>
   <tr>
   	<th width="100">编号</th>
   	<th width="150">老板编号</th>
   	<th width="200">店名</th> 
   	<th width="200">地址</th> 	
   	<th width="150">操作</th>
   	<th width="150">操作</th>  
   </tr>
</thead>
<tbody>
<%
	request.setCharacterEncoding("UTF-8");
	
	int pages = ParamUtil.getInt(request, "pages", 0);
	int id=ParamUtil.getInt(request,"id",0);
	int rowsPerPage = ParamUtil.getInt(request, "pageSize", 10);
	StoreControl sc = new StoreControl();
	Store store = new Store();

	List<Store> list = new ArrayList<Store>();
	list = (List) sc.getStore(pages,rowsPerPage); 
	      
	for (int i = 0; i < list.size(); i++) {
		store = list.get(i);
%>  
	
		<tr>
	    <td align="center"><%=store.getId()%></td>
		<td align="center"><%=store.getBoss_id()%></td>
		<td align="center"><%=store.getStore_name()%></td>
		<td align="center"><%=store.getPlace()%></td>
		<td align="center">
		<a href="store_update.jsp?id=<%=store.getId()%>">信息修改</a>
		</td>
		<td align="center">
		<a href="store_delete_do.jsp?id=<%=store.getId()%>" onclick='return confirm("确定要删除吗？")'>删除</a>
		</td>
		</tr>
	<%
		}
	%>   	
   	</tbody>
   </table>
   
   
    <p>	    
          <input type="button" value="添加店铺" onclick="window.location.href='store_add.jsp'" />
	</p>
	</form>
</body>
</html>